<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <link href="https://gmpg.org/xfn/11" rel="profile">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="generator" content="Hugo 0.80.0" />

  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>JavaScript-part2 &middot; K J</title>
  <meta name="description" content="" />

  
  <link type="text/css" rel="stylesheet" href="http://kartjim.gitee.io/hugo/css/print.css" media="print">
  <link type="text/css" rel="stylesheet" href="http://kartjim.gitee.io/hugo/css/poole.css">
  <link type="text/css" rel="stylesheet" href="http://kartjim.gitee.io/hugo/css/syntax.css">
  <link type="text/css" rel="stylesheet" href="http://kartjim.gitee.io/hugo/css/hyde.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abril+Fatface|PT+Sans:400,400i,700">


  
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
  <link rel="icon" href="/hugo/favicon.png">
  
  
</head>

  <body class="theme-base-09 ">
  <aside class="sidebar">
  <div class="container sidebar-sticky">
    <div class="sidebar-about">
      <a href="http://kartjim.gitee.io/hugo/"><h1>K J</h1></a>
      <p class="lead">
       kart jim`blog 
      </p>
    </div>

    <nav>
      <ul class="sidebar-nav">
        <li><a href="http://kartjim.gitee.io/hugo/">Home</a> </li>
        <li><a href="https://blog.csdn.net/qq_46590483?spm=1001.2100.3001.5343"> CSDN </a></li><li><a href="https://github.com/can-dy-jack"> Github </a></li><li><a href="https://www.cnblogs.com/kartjim"> 博客园 </a></li>
      </ul>
    </nav>

    <p>Copyright 2021 © kart jim</p>
  </div>
</aside>

    <main class="content container">
    <div class="post">
  <h1>JavaScript-part2</h1>
  <time datetime=2020-12-24T23:00:16Z class="post-date">Thu, Dec 24, 2020</time>
  <h1 id="javascript">JavaScript</h1>
<h2 id="文件注释和缩放">文件注释和缩放</h2>
<ul>
<li>注释会增加JavaScript源文件的大小，但是影响较小，可以忽略不计。</li>
<li>在JavaScript正式使用版本一般会清楚文件里的注释和空白，即压缩版本，一般后缀为.min.js。</li>
</ul>
<h2 id="变量">变量</h2>
<ul>
<li>变量区分大小写</li>
<li>命名规则一般是：”驼峰大小写“</li>
</ul>
<h2 id="操作符">操作符</h2>
<p>操作符优先级与其他语言一样，如 java、PHP等。</p>
<h2 id="基本-事件event">基本 事件（event）</h2>
<p>JavaScript使用事件处理器（event handler）来处理事件。
常见的有三个：</p>
<ul>
<li><input disabled="" type="checkbox"> onClick
<ul>
<li>鼠标点击效果</li>
</ul>
</li>
<li><input disabled="" type="checkbox"> onMouseOver
<ul>
<li>鼠标移入效果</li>
</ul>
</li>
<li><input disabled="" type="checkbox"> onMouseOut
<ul>
<li>鼠标移出效果</li>
</ul>
</li>
</ul>
<h3 id="demo">Demo</h3>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html"><span style="color:#75715e">&lt;!DOCTYPE html&gt;</span>
&lt;<span style="color:#f92672">html</span> <span style="color:#a6e22e">lang</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;en&#34;</span>&gt;
&lt;<span style="color:#f92672">head</span>&gt;
    &lt;<span style="color:#f92672">meta</span> <span style="color:#a6e22e">charset</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;UTF-8&#34;</span>&gt;
    &lt;<span style="color:#f92672">meta</span> <span style="color:#a6e22e">name</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;viewport&#34;</span> <span style="color:#a6e22e">content</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;width=device-width, initial-scale=1.0&#34;</span>&gt;
    &lt;<span style="color:#f92672">title</span>&gt;图像翻滚 Demo&lt;/<span style="color:#f92672">title</span>&gt;
&lt;/<span style="color:#f92672">head</span>&gt;
&lt;<span style="color:#f92672">body</span>&gt;
    &lt;<span style="color:#f92672">div</span>&gt;
        &lt;<span style="color:#f92672">img</span> <span style="color:#a6e22e">src</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;favicon.png&#34;</span> <span style="color:#a6e22e">alt</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;onMouseOver&#34;</span> <span style="color:#a6e22e">onmousemove</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;this.src=&#39;test/timg.jpeg&#39;;&#34;</span> <span style="color:#a6e22e">onmouseout</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;this.src=&#39;favicon.png&#39;;&#34;</span>&gt;
    &lt;/<span style="color:#f92672">div</span>&gt;
&lt;/<span style="color:#f92672">body</span>&gt;
&lt;/<span style="color:#f92672">html</span>&gt;
</code></pre></div>
</div>


    </main>

    
      
    
  </body>
</html>
